/*
 * @Author: your name
 * @Date: 2021-06-02 18:30:17
 * @LastEditTime: 2021-06-03 10:41:02
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /emotech-wxapp/Users/liu/work/yh/emotech-weapp/src/reducers/userInfo.js
 */
import { SET_USER, REMOVE_USER } from '../constants/user'

let INITIAL_STATE = {
	userInfo: null,
}

export default function user(state = INITIAL_STATE, action) {
	switch (action.type) {
		case SET_USER:
			return {
				...state,
				userInfo: action.userInfo
			}
		case REMOVE_USER:
			return {
				...state,
				userInfo: null
			}
		default:
			return state
	}
}
